package cn.tedu.io;

import java.io.*;

public class T3_in {
    public static void main(String[] args) throws IOException {
//        method();//使用FileInputStream
        method2();//使用BufferedInputStream
    }
    public static void method2() throws IOException {
        InputStream in2 = new BufferedInputStream(new FileInputStream("F:\\你爸爸\\好好的.txt"));
        int a = 0;
        while((a=in2.read())!=-1){
            System.out.println(a);
        }
        in2.close();


    }
    public static void method() throws IOException {
        //创建对象
        InputStream in = new FileInputStream("F:\\你爸爸\\好好的.txt");
//        InputStream in = new FileInputStream(new File("F:\\你爸爸\\好好的.txt"));
//        int data1=in.read();
//        System.out.println(data1);
//        int data2 = in.read();
//        System.out.println(data2);
//        int data3 = in.read();
//        System.out.println(data3);
        int b=0;
        while((b=in.read())!=-1){
            System.out.println(b);
        }
        in.close();


    }
}
